package com.xiaofeng.pochi.task;

import com.xiaofeng.pochi.service.ShopCouponService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * Created with IntelliJ IDEA
 *
 * @Author: chc
 * @Date: 2022/09/22/20:31
 * @Description:
 */
@Component
public class ShopCouponTask {

    @Autowired
    private ShopCouponService shopCouponService;

    /**
     * 更新优惠券过期时间
     */
    @Scheduled(cron = "0 0/1 * * * ?")
    public void refreshCouponStatus() {
        shopCouponService.updateTimeoutCoupon();
    }

}
